package com.lzh.crypt.exception;

/**
 * @author zhehen.lu
 * @date 2025/8/10 19:52
 */
public class CryptException extends RuntimeException {

    private Integer errorCode;
    private String errorMsg;

    private static final long serialVersionUID = -6225823692487733126L;

    public CryptException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public CryptException(String message, Throwable cause) {
        super(message, cause);
    }

    public CryptException(ErrorCode errorCode) {
        this.errorMsg = errorCode.getErrorMsg();
        this.errorCode = errorCode.getErrorCode();
    }

    public CryptException(String message) {
        super(message);
    }

    public CryptException(Throwable cause) {
        super(cause);
    }

    public Integer getErrorCode() {
        return this.errorCode;
    }

    public String getErrorMsg() {
        return this.errorMsg;
    }
}
